package com.heima.admin.service.impl;


import com.heima.admin.service.IArticleModerationService;
import com.heima.apis.article.IUserClient;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.user.dtos.AuthDto;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
@Slf4j
public class IArticleModerationImpl implements IArticleModerationService {


    @Autowired
    private IUserClient iUserClient;



    /**
     * 通过feign去查询ApUserRealname表里面的分页数据
     * @param authDto
     * @return
     */
    @Override
    public ResponseResult listApUserRealname(AuthDto authDto) {
        log.info("获取分页数据");
        ResponseResult listApuser = iUserClient.listApuser(authDto);

        return listApuser;
    }
    /**
     * 审核失败
     * @param authDto
     * @return
     */
    @Override
    public ResponseResult auditFail(AuthDto authDto){
        log.info("获取到了autoDto数据：{}"+authDto.toString());

        ResponseResult byidRealname = iUserClient.ApuserByidRealname(authDto);

        return byidRealname;
    }

    /**
     * 审核成功
     * @param authDto
     * @return
     */
    @Override
    public ResponseResult authPass(AuthDto authDto) {
        ResponseResult authPass = iUserClient.authPass(authDto);
        return authPass;
    }
}
